<style>
.fui-btn-c {
    height: auto;
    background: #db232b;
    margin: 0.6rem 0.3rem;
    padding: 0.4rem;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
	justify-content:center;
	box-shadow: 0 8px 6px #fcb8c0;
    align-items: center;
	color:#fff;
    position: relative;
	border-radius:2rem;
}

.fui-btn-c .icon {
	font-size:1rem;
	padding-right:0.3rem;
	text-align:right;
}

.fui-btn-c .info {
	text-align:left;
    padding-right: 0.2rem;
    font-size: 0.75rem;
}

.fui-btn-c .info p {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
.weui_cells_radio2 .weui_check:checked + .weui_icon_checked:before {
  color: #db232b;
}
.syscolor {color:{{main.syscolor||'#e10617'}}}
.sysbgcolor {background:{{main.syscolor||'#e10617'}}}
</style>
<div class="fui-page">
	<div class="fui-content">
		<div id="carousel-container" class="carousel slide" data-role="carousel" data-param-auto="true">
			<div class="carousel-inner" role="listbox" style="height:12rem">
				<div ng-class="{'item':1, 'active':$index==0}" ng-repeat="nav in pagedata.pluginset.hdps">
					<a href="{{nav.url}}">
						<img ng-src="{{tomedia(nav.picurl) || '../core/resource/images/banner-1.jpg'}}" style="display: block; width: 100%; height: 100%;">
					</a>
				</div>
			</div>
			<style>
					.fui-swipe-page .fui-swipe-bullet {background: {background}; opacity: {opacity};}
					.fui-swipe-page .fui-swipe-bullet.active {opacity: 1;}
					.fui-swipe-top {height: 14px;position: absolute;left: 0.5rem;top: 0.3rem;color:#fff}
			</style>
			<div ng-if="pagedata.member.nickname" class="fui-swipe-top" style="font-size:0.7rem;"><span>您好！ {{pagedata.member.nickname}}</span></div>
			<div id="carousel-jinyun" class="fui-swipe-page" style="padding: 0 5px; bottom: 10px; ">
				<div class="fui-swipe-bullet" ng-repeat="nav in pagedata.shopset.hdps" ng-class="{'active':$index==0}" data-target="#carousel-container" data-slide-to="{{$index}}"></div>
			</div>
		</div>
		<div class="jybankuai" style="padding:0.5rem">
			<div class="fui-icon-group col-2" style="background:#fff;margin-top:-2.5rem;border-radius:0.5rem">
				<a class="fui-icon-col external" href="javascript:;" ng-click="access_json('jy_weidish_xibei/goodslist//sendtype=2&id='+pagedata.list[0].id)">
					<div class="icon icon-green radius"><i class="icon icon-shipin syscolor" style="font-size:1.6rem;"></i></div>
					<div class="text bold" style="font-size:0.8rem">堂食</div>
					<div class="subtitle">预约点餐，扫码入座</div>
				</a>
				<a class="fui-icon-col external" href="javascript:;" ng-click="access_json('jy_weidish_xibei/goodslist//sendtype=1&id='+pagedata.list[0].id)">
					<div class="icon icon-orange radius"><i class="icon icon-peisong syscolor" style="font-size:1.6rem;"></i></div>
					<div class="text bold" style="font-size:0.8rem">外卖</div>
					<div class="subtitle">外卖下单，快速送达</div>
				</a>
			</div>
		</div>
		<div class="fui-cell-title bold" style="padding-bottom:0;padding-top:0">我的订单 <span ng-click="access_json('jy_weishop/order.list/')" class="subtitle r-f" style="font-weight:400">查看历史订单 <i class="icon icon-more"></i></span></div>
		<div class="jybankuai" style="padding:0.5rem;">
		<div ng-class="{'fui-icon-group selecter':1, 'col-3':!pagedata.pluginset.pinpailink, 'col-4':pagedata.pluginset.pinpailink}" style="background:#fff;border-radius:0.5rem">
				<a class="fui-icon-col external" href="javascript:;" onclick="$('#show_vipcard').modal();" >
					<div class="icon icon-green radius"><i class="icon icon-fukuanma syscolor"></i></div>
					<div class="text">会员码</div>
				</a>
				<a class="fui-icon-col external" href="javascript:;" ng-click="access_json('jy_coupon/myindex/')">
					<div class="icon icon-orange radius"><i class="icon icon-daifukuan1 syscolor"></i></div>
					<div class="text">我的卡包</div>
				</a>
				<a class="fui-icon-col external" href="javascript:;" ng-click="access_json('jy_weidish_xibei/orderdetail/')">
					<div class="icon icon-blue radius"><i class="icon icon-paihao0 syscolor"></i></div>
					<div class="text">我的排号</div>
				</a>
				<a ng-if="pagedata.pluginset.artid" class="fui-icon-col external" href="javascript:;" ng-click="access_json('core/article.list/detail/onlycontent=1&id='+pagedata.pluginset.artid)">
					<div class="icon icon-blue radius"><i class="icon icon-dianpu syscolor"></i></div>
					<div class="text">品牌介绍</div>
				</a>
		</div>
		</div>
		<div ng-if="pagedata.pluginset.no_cube!=1" class="fui-picturew row-2" style="padding: 0 0.15rem">
                <a ng-repeat="item in pagedata.pluginset.cube" ng-if="$index<=1" class="item" style="padding: 0.15rem;">
                    <div class="image">
                        <img ng-src="{{tomedia(item.image) || '../core/resource/images/nopic.jpg'}}">
                    </div>
                </a>
		</div>
		<div class="fui-cell-title bold" style="padding-bottom:0">会员新鲜事 <span ng-click="access_json('jy_weidish_xibei/news/')" class="subtitle r-f"><i class="icon icon-more"></i></span></div>
		<div class="fui-list-group merchgroup" style="background:none" ng-repeat="item in pagedata.pluginset.picnews" ng-if="item.ishot==1">
			<div ng-click="access_json(item.url)" style="height:120px;margin:5px 10px;background:url({{tomedia(item.image)}}) no-repeat 50%;background-size:cover;border-radius: 5px;">
				<div style="height:120px;position:relative;border-radius: 5px;">
					<div style="position:absolute;width:100%;bottom:0;padding:0.2rem;color:#FFFFFF;background-color:rgba(0, 0, 0, 0.3);filter:Alpha(opacity=50);">
						{{item.title}}
					</div>
				</div>
			</div>
		</div>
		<div ng-show="loading" class='infinite-loading'><span class='fui-preloader'></span><span style="margin-left:1.5rem"> 正在加载...</span></div>
</div>
</div>
<div id="show_vipcard"  class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
		<div class="modal-dialog" style="top:30%;">
			<div class="memlogo-area" style="background:url({{tomedia(pagedata.member.cardbg) || '../core/resource/images/cardbg.png'}}) no-repeat 100%">
                    <div class="memlogo">
                        <img ng-src="{{tomedia(pagedata.member.avatar) || '../core/resource/images/gw-user.png'}}">
                    </div>
                    <div class="name">{{pagedata.member.nickname || '匿名'}}</div>
                    <br>
                    <div class="name">{{pagedata.member.mobile || '无手机号'}}</div>
                    <div class="code">
                        <img ng-src="{{tomedia(pagedata.pluginset.logo) || '../addons/jy_weidish_xibei/resource/images/logo.png'}}">
                    </div>
                    <div class="bot">
						<img id="barcode"/>
                        <span class="r-f">{{pagedata.member.group}}</span>
                    </div>
            </div>
		</div>
</div>
<div ng-if="pagedata.showindexvideo" class="popup">
	<div class="popup-body">
		<div class="popup-center" style="background:none;">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showindexvideo=false"></i>
			<video style="border-radius:0.5rem;width:100%;height:100%;object-fit:fill" poster="{{tomedia(pagedata.pluginset.indexvideoimg) || '../addons/jy_weidish_xibei/resource/images/mobile-hdp01.jpg'}}" controls="" x5-playsinline="" playsinline="" webkit-playsinline="" preload="auto">
					  <source src="{{tomedia(pagedata.pluginset.indexvideo) || '../addons/jy_weidish_xibei/resource/images/indexvideo.mp4'}}" type="video/mp4">					 
			</video>
		</div>
	</div>
</div>
<div ng-include="sys_html('common/_welcomehdp',true)"></div>
<div ng-include="sys_html('_diycss')"></div>
<script type="text/javascript">
scope.pagedata.params={}
scope.pagedata.post={'sendtype':2,'dayid':0}
// 百度地图API功能
window.scope.location(function(re){
	re=re?re:{}
	var lat_lng = re.lat_lng?re.lat_lng:{};
	scope.tool.get_list('jy_weishop/store.index/getlist/limit=2&lat='+lat_lng.lat+'&lng='+lat_lng.lng,true);
});
scope.pagedata.selecttime=function(){
	$('#selecttime').modal();
	var store_id=scope.pagedata.post.id
	scope.get('jy_weidish_xibei/index/out_time/store_id='+store_id,function(res){
		scope.pagedata.out_time=res.out_time;
		scope.pagedata.predict_time=res.predict_time;
		scope.pagedata.timestamp=res.timestamp;
		scope.$evalAsync();
	});
}
</script>
<script>
	require(['bootstrap', 'hammer'], function($, Hammer){
		$('#carousel-container').carousel();
		var mc = new Hammer($('#carousel-container').get(0));
		mc.on("panleft", function(ev) {
			$('#carousel-container').carousel('next');
		});
		mc.on("panright", function(ev) {
			$('#carousel-container').carousel('prev');
		});
	});
</script>
<script>
scope.pagedata.issocketmsg=false;
scope.pagedata.tanmuspage=0;
scope.pagedata.nowmsgid=0;
scope.pagedata.gettanmus=function() {
	if(!scope.pagedata.issocketmsg){
			scope.get('jy_weishop/get_data/gettanmus/page='+scope.pagedata.tanmuspage,function(res){
						//console.log(res);
						scope.pagedata.tanmus=res.list
						if(scope.pagedata.tanmus.length>0){
							scope.pagedata.tanmuspage++;
							scope.pagedata.up_oldtanmu();
						}
			});
	}
}
//前端先注册以等待接收消息
require(['jinyun_socket'],function(jinyun_socket){	
    jinyun_socket.connect(function(res){
			console.log('加入ID为index的组：');console.log(res);
            jinyun_socket.join('index');//加入ID为1的组
     });	 
    jinyun_socket.onsystem=function(res){
        console.log('收到来自后端的消息：');console.log(res);
		scope.pagedata.issocketmsg=true;
		if(scope.pagedata.pluginset.no_tanmu!=1){
			set_tanmu(res.nickname,res.avatar,res.time);
		}
    }
	//刚进入时；如果没有新订单消息，就弹储备订单消息
	if(scope.pagedata.pluginset.no_tanmu!=1){
		setTimeout(function(){
			scope.pagedata.gettanmus();
		},2000);
	}
});
scope.pagedata.up_oldtanmu=function() {
		if(scope.page.action=='index'){
			var i=scope.pagedata.nowmsgid;
			if(i<scope.pagedata.tanmus.length){
				set_tanmu(scope.pagedata.tanmus[i].nickname,scope.pagedata.tanmus[i].avatar,scope.pagedata.tanmus[i].time);
			}else{
				scope.pagedata.gettanmus();
			}
		}else{
			return false;
		}
}
function set_tanmu(nickname,avatar,time) {
		scope.pagedata.nowmsgid++
		scope.pagedata.showtanmus=true
		scope.$evalAsync(scope.pagedata.showtanmus);
		setTimeout(function(){
			scope.pagedata.transition=true
			scope.$evalAsync(scope.pagedata.transition);	
		},300);
		setTimeout(function(){
			scope.pagedata.showtanmus=false
			scope.pagedata.transition=false
			scope.$evalAsync(scope.pagedata.showtanmus);	
		},2000);
		setTimeout(function(){
			//等待5秒，如果没有新的订单消息，就弹储备订单消息
			scope.pagedata.issocketmsg=scope.pagedata.issocketmsg?scope.pagedata.issocketmsg:false;
			if(!scope.pagedata.issocketmsg && scope.page.action=='index'){
				scope.pagedata.up_oldtanmu();
			}
		},4000);
}
</script>
<div ng-include="sys_html('common/pluginnav',true)"></div>
<div ng-include="sys_html('common/_coupon',true)"></div>
<div ng-include="sys_html('common/_h5game',true)"></div>
<div ng-include="sys_html('common/_share','','','jy_weishop')"></div>
<div ng-include="sys_html('common/_sales','','','jy_weishop')"></div>
<!--弹目-->
<div ng-if="pagedata.showtanmus && !pagedata.pluginset.no_tanmu" class="video-sms-pane {{pagedata.transition?'transition':''}}">
		<div class="video-sms-text">
			<image class="video-sms-logo" src="{{pagedata.tanmus[pagedata.nowmsgid].avatar}}"/>
			<span class="overflow-h"> 最新订单来自 {{pagedata.tanmus[pagedata.nowmsgid].nickname}}</span>
		</div>
</div>